#_*_ coding: utf-8 _*_
from django.db import models

# Create your models here.

class Post(models.Model):
    author = models.CharField(max_length=50)
    tvbv = models.CharField(max_length=10)
    message = models.TextField()
    post_date = models.DateField()

    def __unicode__(self):
        return self.author

    class Meta:
        ordering = ['post_date']
        verbose_name = u"пост"
        verbose_name_plural = u"посты"


class Answer(models.Model):
    author = models.CharField(max_length=50)
    tvbv = models.CharField(max_length=10)
    message = models.TextField()
    answ_date = models.DateField()
    post = models.ForeignKey(Post)

    def __unicode__(self):
        return self.author

    class Meta:
        ordering = ['answ_date']
        verbose_name = u"ответ"
        verbose_name_plural = u"ответы"
